#pragma once

#include <linux/const.h>
#include <asm/bitsperlong.h>
#include <linux/types.h>

#define BIT_MASK(nr)		((unsigned long)1 << ((nr) % BITS_PER_LONG))
#define BIT_WORD(nr)		((nr) / BITS_PER_LONG)

#define BIT(nr)			(1UL << (nr))

#define BITS_PER_BYTE 8

#define ___GENMASK(h, l, bpl) \
        (((~_UL(0)) - (_UL(1) << (l)) + 1) & \
         (~_UL(0) >> (bpl - 1 - (h))))

#define GENMASK(h, l) ___GENMASK(h, l, BITS_PER_LONG)
